/**
 *  JSimProd - Java simulation code for production processes
 *  Copyleft Jorge Mira Yagüe <jorge.mira.yague@gmail.com>
 *  Universidad de Alicante 2009
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package lib.model.distribution;

/**
 * This class defines an Static Distributions, where the value specified has
 * a probability of 1.
 * @author Jorge Mira Yagüe
 */
public class StaticDistribution extends Distribution {

    /**
     * Builds an empty static distribution
     */
    public StaticDistribution() {
        super(DistributionType.STATIC, 0, 0);
    }

    /**
     * Builds a probability distribution which returns always the same value
     * @param value the value to be returned
     */
    public StaticDistribution(double value) {
        super(DistributionType.STATIC, value, 0);
    }

    /**
     * Returns the static value of the distribution
     * @return the static value of the distribution
     */
    @Override
    public double getResult() {
        return mean;
    }
}
